/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package simple;

import algorithm.*;
import simple.DefaultIndividual;

/**
 *
 * @author vermaak
 */
public class Factory {
    public static Individual createIndividual(Class individualClass, Genotype genotype) {
        if (individualClass.equals(DefaultIndividual.class)) {
            return new DefaultIndividual(genotype);
        }
        
        throw new RuntimeException("Individuals of class " + individualClass + " need factory implementation.");
    }
    
    public static Population createPopulation(Class populationClass) {
        if (populationClass.equals(ListPopulation.class)) {
            return new ListPopulation();
        }
        
        throw new RuntimeException("Populations of class " + populationClass + " need factory implementation.");
    }
    
}
